<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib  prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%@ page language= "java" contentType="text/html;charset=UTF-8"%> 
    <div id="links">
        <a id="link-add-cost" href="#">记支出</a>
    </div>
    <p/>
        
    <div class="ui-widget">
    <table class="ui-widget ui-widget-content">
       <thead>
           <tr class="ui-widget-header ">
               <th>id</th><th>日期</th><th>支出类型</th><th>支出账户</th><th>金额</th><th>注释</th><th>操作</th>
           </tr>
       </thead>
       <tbody id="item-table-body">
       <c:if test="${fn:length(costs) > 0}">
           <c:forEach items="${costs}" var="cost">
           <tr>
             <td><c:out value="${cost.id}"/></td>
             <td> <fmt:formatDate pattern="yyyy/MM/dd" value="${cost.costDate}" /></td>

             <td>
             <c:if test="${cost.costType.parent != null}">
                <c:out value="${cost.costType.parent.name}"/>&nbsp;->&nbsp;
             </c:if>
             <c:out value="${cost.costType.name}"/>
             </td>

             <td>
             <c:if test="${cost.assetType.parent != null}">
                <c:out value="${cost.assetType.parent.name}"/>&nbsp;->&nbsp;
             </c:if>
             <c:out value="${cost.assetType.name}"/>
             </td>

             <td><c:out value="${cost.amount}"/></td>
             <td><c:out value="${cost.comment}"/></td>

             <td><a id="delete-cost-<c:out value='${cost.id}'/>" href="#" >删除</button></td>

           </tr>
       </c:forEach>
       </c:if>
       </tbody>
       </table>
   </div>
 <jsp:include page="AddCost.jsp"/>




